package cn.fws.meap.utils.articleUtil;

import cn.fws.framework.utils.StringUtils;
import cn.fws.framework.utils.UUIDUtils;
import cn.fws.meap.community.entity.ProblemResources;

import java.util.ArrayList;
import java.util.Date;
public class ProblemResourceUtil {

    public static void addProRes(String articleId, String
            resIds, ArrayList<ProblemResources> problemResources, Date date){
        if (StringUtils.isNotEmpty(resIds)) {
            String[] resIdsSplit = resIds.split(",");
            for (String resId : resIdsSplit) {
                ProblemResources problemResourcesMsg = new ProblemResources();
                problemResourcesMsg.setId(UUIDUtils.getUUID());
                problemResourcesMsg.setProblemId(articleId);
                problemResourcesMsg.setResourcesId(resId);
                problemResourcesMsg.setCreateTime(date);
                problemResources.add(problemResourcesMsg);
            }
        }
    }
}
